import { NavigationGuard } from "vue-router";
import { getLocal } from "UTILS";
import store from '../store'
const Redirect: any = null;
const routeBefore: NavigationGuard = (to, from, next) => {
  debugger
  if (to.path === "/login") {
    localStorage.clear();
    next();
  } else {
    if (store.state.token) {
      next();
    } else {
      next({ path: "/login" });
    }
  }
};
export default routeBefore;
export { Redirect };
